if (strcmp(fmp->key, "LON_DIR") == 0) {
/* longitude E/W. Ingore on input for now */
} else
-
+ /* SPECIAL COORDINATES/GRID */
+ if (strcmp(fmp->key, "MAP_EN_BNG") == 0) {
+ parse_coordinates(s, DATUM_OSGB36, grid_bng,
+ &wpt->latitude, &wpt->longitude, MYNAME);
+ } else
/* ALTITUDE CONVERSIONS ************************************************/
if (strcmp(fmp->key, "ALT_FEET") == 0) {
/* altitude in feet as a decimal value */
writebuff(buff, fmp->printfc,
LON_DIR(lon));
} else
+
+ /* SPECIAL COORDINATES */
+ if (strcmp(fmp->key, "MAP_EN_BNG") == 0) {
+ char map[3];
+ double north, east;
+ if (! GPS_Math_WGS84_To_UKOSMap_M(wpt->latitude, wpt->longitude, &east, &north, map))
+ fatal(MYNAME ": Position (%.5f/%.5f) outside of BNG.\n",
+ wpt->latitude, wpt->longitude);
+ snprintf(buff, sizeof(buff), fmp->printfc, map, (int)(east + 0.5), (int)(north + 0.5));
+ } else
/* ALTITUDE CONVERSIONS**********************************************/
if (strcmp(fmp->key, "ALT_FEET") == 0) {
</screen>
</section>
+<section id="style_def_map_en_bng">
+<title>MAP_EN_BNG</title>
+<para>
+ MAP_EN_BNG converts coordinates from/to British National Grid (BNG).
+</para>
+<para>
+ The only supported order of the items is: Map,Easting,Northing.
+ During output all coordinates have to be located within this limited area.
+</para>
+<para>
+examples:
+</para>
+<screen format="linespecific">
+ IFIELD MAP_EN_BNG,"","%s%5d %5d" # (writes i.e. "SJ00001 00001")
+ IFIELD MAP_EN_BNG,"","%s %d %d" # (writes i.e. "TQ 888 999")
+</screen>
+</section>
+
<section id="style_def_lonhuman">
<title>LON_HUMAN_READABLE</title>
<para>